<template>
    <div class="box">
        <el-container>
            <el-header style="background-color:	#6E6E6E" height="60px">
                 <my-header/>
            </el-header>
            <el-main>
                <el-container>
                     <el-aside style='background-color:#324157' :width="barWidth">
                        <my-side :isCollapse="isCollapse"/>
                     </el-aside>
                     <el-main>
                         <el-container>
                             <el-main>
                                <transition name="move" mode="out-in">
                                    <router-view></router-view>
			                    </transition>
                             </el-main>
                             <el-footer height="25px">2017 © copyright 后台管理系统基础模板</el-footer>
                         </el-container>
                     </el-main>
                </el-container>
            </el-main>
            
        </el-container>
    </div>
</template>
<script>
import Header from '@/components/common/Header'
import SideBar from '@/components/common/SideBar'
import bus from './eventBus'
export default {
    components: {
        'my-header': Header,
        'my-side': SideBar
    },
    computers:{
    },
    data(){
        return {
            widthClass: {
                width: this.mainWidth
            },
            isCollapse: false,
            barWidth: '200px'
        }
    },
    methods: {
    
    },
    mounted(){
        // bus.$on('changeSide',()=>{
        //     this.isCollapse = !this.isCollapse;
        //     if(!this.isCollapse){
        //         this.barWidth = '200px'
        //     }else{
        //         this.barWidth = '64px'
        //     }
        //     console.log(this.isCollapse)
        // });
    }
}
</script>

<style>
.el-header, .el-aside, .el-main, .el-footer {
    padding: 0;
    margin: 0;
}

.el-container{
    height: 100%;
}
.el-footer{
    color:#5A5E66;
    text-align: center;
}
.box{
    display: flex;
    flex-direction: column;
     height: 100%; 
}
</style>

